//
//  WYClueCell.m
//  CirclePush
//
//  Created by admin on 2018/4/19.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYClueCell.h"
@interface WYClueCell()

@property (strong, nonatomic) IBOutlet UILabel *orderLabel;

@property (strong, nonatomic) IBOutlet UILabel *statusLabel;
@property (strong, nonatomic) IBOutlet UILabel *title;
@property (strong, nonatomic) IBOutlet UILabel *timeLabel;

@end
@implementation WYClueCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setModel:(WYClewModel *)model
{
    _model = model;
    
    self.orderLabel.text =[NSString stringWithFormat:@"订单号：%@",model.demand.mediaOddNumber] ;
    
    if ([model.demand.status isEqualToString:@"4"]) {
        self.statusLabel.text = @"已完成";
        self.statusLabel.textColor = [UIColor hexStringToColor:@"#3B80F9" alpha:1.0];
    }else if([model.demand.status isEqualToString:@"5"]){
        self.statusLabel.text = @"已关闭";
        self.statusLabel.textColor = [UIColor hexStringToColor:@"#333333" alpha:1.0];
    }else{
        self.statusLabel.text = @"进行中";
        self.statusLabel.textColor = [UIColor hexStringToColor:@"#DB5C35" alpha:1.0];
    }
    
    self.title.text = model.demand.demandType;
    
    self.timeLabel.text = [NSString stringWithFormat:@"提交时间：%@",[self creatTimeForTimeInterval:model.demand.createTime]];
}
-(NSString *)creatTimeForTimeInterval:(NSString *)timeInterVal
{
    //NSString *timeStampString  = orderMessage.waitTime;
    // iOS 生成的时间戳是10位
    NSTimeInterval interval    =[timeInterVal doubleValue] / 1000.0;
    NSDate *date               = [NSDate dateWithTimeIntervalSince1970:interval];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    NSString *TempString       = [formatter stringFromDate: date];
    return TempString;
    
}







@end
